// 封装所有与权限相关的接口
import request from '@/utils/request'

// 根据 id 改
export function setSysPermissionApi (data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}
// 根据 id 查
export function getSysPermissionApi (id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
// 根据 id 删
export function delSysPermissionApi (id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
// 增
export function addSysPermissionApi (data) {
  return request({
    url: `/sys/permission`,
    method: 'POST',
    data
  })
}
// 查询所有
export function getAllPermissionApi () {
  return request({
    url: `/sys/permission`
  })
}
